<?php
/* @var $this SendsmslogController */
/* @var $model Sendsmslog */

$this->breadcrumbs=array(
	'Sendsmslogs'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'短信群发日志', 'url'=>array('admin')),
	// array('label'=>'群发短信', 'url'=>array('create')),
);
 
?>

<h1>短信群发日志</h1> 

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'sendsmslog-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
	'enableHistory'=>true,
    'template'=>"{items}{summary}{pager}",
    'summaryText'=>'每页显示10条,共{count}条',
    'summaryCssClass'=>'summaryinfo',
    'emptyText'=>'没有数据',
    'itemsCssClass'=>'itemsinfo',
    'pager'=>array(
        'class'=>'CLinkPager',
        'header'=>'',
        'nextPageLabel'=>'下一页',
        'prevPageLabel'=>'上一页',
        'firstPageLabel'=>'首页',
        'lastPageLabel'=>'尾页', 
        ),
	'columns'=>array( 
		// 'id', 
		// 'userid',
		// 'companyid',
		array(  
            'header' => '序号',  
            'value' => '$this->grid->dataProvider->getPagination()->getOffset()+($row+1)', //CDataColumn $this->grid  
            'htmlOptions' => array(  
                'width' => '40px',  
                "style"=> 'text-align:center',
            ),  
        ), 
         array(
            'name'=>'mobile',
            'value'=>'preg_replace("/(1\d{1,3})\d\d(\d{0,2})/", "\$1****\$3", $data->mobile)',
        ),  
		array(
            'name'=>'sended',
            'value'=>'($data->sended == 1?"成功":"失败");', 
        ),  
		// 'content', 
		array(
            'name'=>'createtime',
            'value'=>'date("Y-m-d H:i",strtotime($data->createtime));', 
        ), 
		array(
			'class'=>'CButtonColumn',
			 'header' => '操作', //指明头信息  
			 'template'=>'{view}',  
             'buttons' =>array(    
                'view' => array(    
                    'label'=>'显示',    
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/caz.png',   
                ),
                'update' => array(    
                    'label'=>'修改',    
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/bianji.png',   
                ),
                'delete' => array(    
                    'label'=>'删除',    
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/shanc.png',   
                ), 
            ),       

		),
	),
)); ?>

